from django.contrib import admin

# Register your models here.
from crm import models


class MenuAdmin(admin.ModelAdmin):
    list_display = ('name', 'url_type', 'url_name')
    list_editable = ('url_type', 'url_name')
    list_filter = ('url_type',)


class RoleAdmin(admin.ModelAdmin):
    filter_horizontal = ('menus',)


class CustomerAdmin(admin.ModelAdmin):
    list_display = ('name', 'qq', 'consultant', 'source', 'consult_content', 'status', 'date')
    list_filter = ('source', 'status', 'consultant')
    search_fields = ('qq', 'name')
    list_editable = ('status',)
    list_per_page = 3


admin.site.register(models.Customer, CustomerAdmin)
admin.site.register(models.FollowUpRecord)
admin.site.register(models.Enrollment)
admin.site.register(models.ClassList)
admin.site.register(models.StudyRecord)
admin.site.register(models.UserProfile)
admin.site.register(models.Branch)
admin.site.register(models.Role, RoleAdmin)
admin.site.register(models.Menu, MenuAdmin)
admin.site.register(models.Course)
admin.site.register(models.CourseRecord)

